Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cycle wallpaper and theme #2

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Davi-S
Copy link

@Davi-S Davi-S commented Dec 1, 2024

Pull Request

Description

This pull aims to append two new scripts that can cycle through all installed wallpapers and themes and set them for the desktop and SDDM Corners theme. This is useful for those who want to see all wallpapers and themes they have installed or just is undecided on which one to use; for the latter, the user can set a cronjob to run the script periodically, thus having a new look on its PC from time to time.

(SDDM wallpaper will match the one on the desktop)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (non-breaking change; modified files are limited to the documentations)
  • Technical debt (a code change that does not fix a bug or add a feature but makes something clearer for devs)
  • Other (provide details below)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit message follows the commit guidelines.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added a changelog entry.
  • I have added necessary comments/documentation to my code.
  • I have added tests to cover my changes.
  • I have tested my code locally and it works as expected.
  • All new and existing tests passed.

Add script to cycle through and set wallpaper and themes for desktop and login screen
The whole file was remade. Original output and use stays the same.
@kRHYME7
Copy link
Contributor

kRHYME7 commented Dec 2, 2024

Thank you for using snake_case! I need to rework some scripts to follow this convention. Will test it later. Looks like you hardcode some paths.

Comment on lines 1 to 2
#!/usr/bin/env sh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use bash in your shebang if the script is not POSIX (sh) at all, so the linters won't scream.

Suggested change
#!/usr/bin/env sh
#!/usr/bin/env bash

Comment on lines 4 to 13
WALL_SCRIPT="$HOME/.local/share/bin/swwwallpaper.sh"
THEME_SCRIPT="$HOME/.local/share/bin/themeswitch.sh"
#SDDM_SCRIPT="$HOME/bin/setsddmwallpaper"
SDDM_SCRIPT="$HOME/.local/share/bin/setsddmwallpaper.sh"
LOG_FILE="$HOME/.local/share/cyclewallpaperandtheme.log"
WALL_CYCLE_FILE="$HOME/.local/share/cyclewallpapercount"
THEME_CYCLE_FILE="$HOME/.local/share/cyclethemecount"
THEME_CHANGE_FLAG_FILE="$HOME/.local/share/cyclethemeflag"
THEMES_DIR="$HOME/.config/hyde/themes"
HYDE_CONFIG="$HOME/.config/hyde/hyde.conf"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too hardcoded, I will expose a global variables later and will use it so global stuff can be source/imported. Also don't put logs in .local/share.

Add the path to the script itself and source the global control to update the variable paths
@Davi-S
Copy link
Author

Davi-S commented Dec 3, 2024

@kRHYME7, I made changes based on your comments. What do you think?

@Anshul-007
Copy link
Contributor

Can you switch to#! /bin/env bash, I think we are sticking to this convention.

@kRHYME7 kRHYME7 changed the title Cicle wallpaper and theme Cycle wallpaper and theme Dec 17, 2024
@kRHYME7
Copy link
Contributor

kRHYME7 commented Dec 17, 2024

@Davi-S Please resolve reviews. I won't merge the sddm script as this is not a good approach, you can remove it for now so we can move forward

Comment on lines 3 to 7
# Configuration
SDDM_THEME_CONFIG="/usr/share/sddm/themes/Corners/theme.conf"
BACKGROUND_DIR="/usr/share/sddm/themes/Corners/backgrounds"
WALLPAPER_NAME="customwallpaper"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HyDE does have Candy theme too. how to handle it. This is the reason why there's 2 sddm wallpaper setter script in the PR. Both don't handle the other theme. Also this is the reason @prasanth remove the script. We should rethink how to properly do it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to make the "cyclewallpaperandtheme.sh" have a display manager script as parameter?
This way the user can create/edit the scripts as he likes to make them work for any theme or display manager he uses. AKA: Dependency Injection to achieve Inversion of Control

The cyclewallpaperandtheme.sh script now can receive a display-manager-wallpaper-script as argument instead of relying on a predefined script.

The display manager scripts must have the wallpaper path as argument. It will be passed by the cyclewallpaperandtheme.sh script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants